<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    /**
     * @var int
     */
    private $code = 0;

    /**
     * @var array
     */
    private $data = [];

    /**
     * @var string
     */
    private $message = '操作成功';


    /**
     * @param $param
     * @param $value
     */
    public function set($param, $value)
    {
        $this->$param = $value;
    }


    /**
     * @return array
     * ajax 返回格式
     */
    public function ajaxResponse()
    {
        return [
            'code'=>$this->code,
            'message'=>$this->message,
            'data'=>$this->data
        ];
    }
}
